import os
import re
#num = 1

for file in os.listdir(path='/home/s/Downloads/label/'):
    print(file)
    with open('/home/s/Downloads/label/'+file, "r+", encoding='utf-8') as f:
    # readlines()：读取文件全部内容，以列表形式返回结果
        data = f.readlines()
        print(data)
        changed_data = ''
        for item in data:
            #print(item)
            text = list(item)    #将字符串转换为列表，列表的每一个元素为一个字符
            #print(text[0])
            if (text[0]=='3'):
                text[0] = '5' 
                text = ''.join(text)     #将列表重新连接为字符串
            else:
                text = ''.join(text)     #将列表重新连接为字符串
            changed_data = changed_data+text
            #print(text)
        newf = open('/home/s/Downloads/label/'+file, 'r+', encoding='utf-8')
        newf.write(changed_data)
        newf.close()
